[paper] bitcoin

Published on 2020-12-18

Transaction

How to do a transaction

  1. get the hash of the previous transaction
  2. get the next owner's public key
  3. combine them together
  4. sign the combined hash with own private key

But still the payee can't verify the payer didn't do a double spend. To guaranty there is no double spend all the transactions are made public. Then it's required for all the peers to agree on a single history of the order which transactions happened.

Timestamp Server

Get a block of data and hash it, then publish the hash with the current time stamp.

proof of work

To make this timestamp server work peer-to-peer, it requires a proof of work to do a hash. This proof-of-work is that each hash should have a certain number of 0s at the beginning. How to achieve this is,

So once the hashing done for a block, to tamper it this proof-of-work has to be repeated. And as the new blocks are added to the chain, it gets harder to tamper old blocks (because it will require to change the hash of all the blocks after that tampered block). This way the longest chain of blocks represent the majority vote. To compensate for increasing hardware power, and varying interest in running a node the difficulty of the proof-of-work is changed based on average number of blocks per hour.

Network

  1. New transactions are broadcast to all nodes.
  2. Each node collects new transactions into a block.
  3. Each node works on finding a difficult proof-of-work for its block.
  4. When a node finds a proof-of-work, it broadcasts the block to all nodes.
  5. Nodes accept the block only if all transactions in it are valid and not already spent.
  6. Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.

incentive

will come from mining new coins and doing transactions.

reclaiming disk space

transactions are hashed in a merkle tree, only root includes the blocks hash.